package com.hll.javaweb.servlet.dispatcher;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author hll
 * @create 2022-05-10 12:32
 */
@WebServlet("/hello-dis-03")
public class HelloDispatcher_03 extends HttpServlet {
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    // 浏览器成功跳转，但url显示的还是 .../hello-dis-03
    req.getRequestDispatcher("/pages/hello.html").forward(req, resp);
  }
}
